#include <iostream>
#include <fstream>
#include <ctime>
#include <cstdio>
#include <cstdlib>

using namespace std;

int main(int argc, char **argv)
{
  ofstream file(argv[1]);
  int numberOfNodes = atoi(argv[2]); 
  int numberOfEdges = atoi(argv[3]); 

  srand(time(NULL));

  file << numberOfNodes << endl;
  file << numberOfEdges << endl;

  for (int i = 0; i < numberOfEdges; i++) {
    int node1 = (rand() % numberOfNodes) + 1;
    int node2 = (rand() % numberOfNodes) + 1;
    
    file << node1 << " " << node2 << endl;
  }
}
